import java.util.Scanner;

public class SWS{
    /*public static void main(String[] args) {
        int sum=0;
        for (int i=0;i<=100;i++){
            if (i%2!=0){
                sum+=i;
            }
        }System.out.println(sum);
    }*/
    /*public static void main(String[] args) {
        Scanner ss=new Scanner(System.in);
        System.out.println("请输入要判断的数");
        int n= ss.nextInt();
        int i=0;
        for (i=2;i<=n-1;i++){
            if (n%i==0){
                System.out.println(n+"不是素数");
                break;
            }
            if (i==n){
                System.out.println(n+"是素数");
            }
        }
    }*/
    public static void main(String[] args) {
        int ge,shi,bai;
        int m=0;
        int x=0;
        for (int i=100;i<=999;i++){
            bai=i/100;
            shi=i/10%10;
            ge=i%10;
            int b=(int) (Math.pow(ge,3)+Math.pow(shi,3)+Math.pow(bai,3));
                    if(i==b){
                        System.out.println(i);
                        x+=i;
                        m++;
            }
        }
        System.out.println(x);
        System.out.println(m);
    }
}
